//***************************************************************
//  File:    GameObject.h
//  Date:    12/17/2012
//  Author:  liangxc (liangxc2010@gmail.com)
//-------------------------------------------------------------
//
//-------------------------------------------------------------
//  This file is part of Hare2D Game Engine.
//  Copyright (C) All Rights Reserved
//***************************************************************
//
//***************************************************************
#ifndef __GAMEOBJECT_H__
#define __GAMEOBJECT_H__

#include "Component.h"

namespace hare
{

	class GRAPHICS_API GameObject : public Object
	{
		HARE_DECLARE_DYNAMIC_CLASS(GameObject)
	public:
		GameObject();
		virtual ~GameObject();

		virtual void update();
		virtual void render();

		bool getEnable();
		void setEnable(bool flag);

		virtual const PointF& getPosition();
		void setPosition(float x, float y);
		void move(float x, float y);

		virtual const PointF& getRotation();
		void setRotation(float x, float y);

		virtual const PointF& getScale();
		void setScale(float x, float y);

		void AddComponent();

	protected:
		bool enable;

		PointF position;
		PointF rotation;
		PointF scale;

		Component::List componentList;

	public:
		GameObject* parent;
		GameObject* child;
		GameObject* prev;
		GameObject* next;
	};
}


#endif